package org.fullhappy.business;

import java.awt.MenuItem;
import java.util.ArrayList;
import java.util.List;
import javax.faces.model.SelectItem;
import org.fullhappy.dao.MusicCategoryFacade;
import org.fullhappy.entity.MusicCategory;
import org.fullhappy.model.MenuItemModel;

public class MusicCategoryService {

    private MusicCategoryFacade musicCategoryFacade;

    public MusicCategoryService() {
        musicCategoryFacade = new MusicCategoryFacade();
    }

    public ArrayList<SelectItem> getSelectItems() {
        ArrayList<SelectItem> items = new ArrayList<SelectItem>();
        List<MusicCategory> entities = musicCategoryFacade.findAll();
        if (entities != null && entities.size() > 0) {
            for (MusicCategory x : entities) {
                items.add(new SelectItem(x.getCategoryId(), x.toString()));
            }
        }
        return items;
    }

}
